import { useFetchPost } from '~/composables/useHttp/useFetch'
import { useFetchRefPost } from '~/composables/useHttp/useFetchRef'

/**
 * 已审核友情链接列表
 */
export const linkApi = (p = 1) => {
    return useFetchRefPost<LinksVo>('linksApi', '/link/list', {
        body: { pageNum: p, pageSize: 15 }
    })
}
/**
 * 友链申请
 */
export const linkApplyApi = <T>(body: T) => {
    return useFetchPost<R<T>>('linkApplyApi', '/link/apply', {
        body: body!
    })
}
/**
 * 增加友链访问量
 */
export const lookLinkApi = <T>(linkId: string) => {
    return useFetchPost<R<T>>('lookLinkApi', `/link/look/${linkId}`)
}